| Conditions | 2 |
| Total Lines | 13 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 35 | |||
| 36 | @Post() |
||
| 37 | public async post(@Body() customerDto: CustomerDTO, @Res() res: Response) { |
||
| 38 | const { street, city, zipCode, country, name } = customerDto; |
||
| 39 | |||
| 40 | try { |
||
| 41 | await this.commandBus.execute( |
||
| 42 | new CreateCustomerCommand(name, street, city, zipCode, country) |
||
| 43 | ); |
||
| 44 | |||
| 45 | res.redirect(303, this.resolver.resolve('crm_customers_list')); |
||
| 46 | } catch (e) { |
||
| 47 | throw new BadRequestException(e.message); |
||
| 48 | } |
||
| 51 |